package exercises.newcoder.util;

/**
 * <a href="">
 * </a>
 *
 * <p><span color="#87CEEB">描述:</span>
 *
 * @author or2
 * @date 2021年09月28日 时间: 9:34
 */
public class Common {

    public static String[][] StrToString2Array(String str) {
        str = str.substring(1, str.length() - 1);
        String[] split = str.split("(?<=]),(?=\\[)");
        String[][] res = new String[split.length][];
        for (int i = 0; i < split.length; i++)
            res[i] = StrToStringArray(split[i]);
        return res;
    }

    public static String[] StrToStringArray(String str) {
        str = str.substring(1, str.length() - 1);
        str = str.replace("\"", "");
        return str.split(",");
    }
}
